package 栈;

public class measure {
   /* public boolean isValid(String s){
        LinkedListStack<Character> stack=new LinkedListStack<>(s.length());//确定好泛型
        for(int i=1;i<s.length();i++){
            char c=s.charAt(i);
            if(c=='('){
                stack.push(')');
            }
            else if(c=='['){
                stack.push(']');
            }
            else if(c=='{'){
                stack.push('}');
            }
            else {
                if((c==stack.peek())&&(!stack.isEmpty())){
                    stack.pop();
                }
                else {
                    return false;
                }
            }
        }
        return !stack.isEmpty();//其为空则说明所有的匹配成功
    }

    public static void main(String[] args) {
        measure a=new measure();
        System.out.println(a.isValid("([]}"));
        System.out.println(a.isValid("({})"));
    }*/

}
